using System;

namespace Voodoo.Distribution
{
	[Serializable]
	public class LocalizationSheet
	{
		public string name;

		public string[] languageCodes;

		public LocalizationRow[] translationRows;

		public LocalizationSet GetLocalizationSet()
		{
			LocalizationSet localizationSet = new LocalizationSet();
			string[] array = languageCodes;
			int num = ((array != null) ? array.Length : 0);
			LocalizationRow[] array2 = translationRows;
			int num2 = ((array2 != null) ? array2.Length : 0);
			for (int i = 0; i < num; i++)
			{
				LanguageRegistry languageRegistry = new LanguageRegistry();
				for (int j = 0; j < num2; j++)
				{
					LocalizationRow localizationRow = translationRows[j];
					languageRegistry.translations.Add(localizationRow.key, localizationRow.translations[i]);
				}
				localizationSet.languages.Add(languageCodes[i].ToUpper(), languageRegistry);
			}
			return localizationSet;
		}
	}
}
